<template>
	<view class="mainbgc" v-if="pageShow">
		<header-top :messageInfo="{typeFlag:true,message:'库存调拨详情',liner:false}"></header-top>
		<view class="mainpadding_top flexbetween ffffff">
			<view class="titletext">{{dataAll.order_no}}</view>
			<!-- 10=出库待审核,20=已出库,30=已入库,40=出库未通过,50=入库未通过 -->
			<view class="wlable radius" v-if="dataAll.status==10">出库待审核</view>
			<view class="shlable radius" v-if="dataAll.status==20">已出库</view>
			<view class="shlable radius" v-if="dataAll.status==30">已入库</view>
			<view class="hlable radius" v-if="dataAll.status==40">出库未通过</view>
			<view class="hlable radius" v-if="dataAll.status==50">入库未通过</view>
		</view>
		<view class="mainpadding_top ffffff">
			<view class="flexleft margin_top paddingbom">
				<view class="nostrongtext">创建时间：</view>
				<view class="strongtext">{{dataAll.createtime_text}}</view>
			</view>
			<view class="flexleft margin_top paddingbom">
				<view class="nostrongtext">经办人：</view>
				<view class="strongtext">{{dataAll.staff.username}}</view>
			</view>
			<view class="flexleft margin_top paddingbom">
				<view class="nostrongtext">出库仓库：</view>
				<view class="strongtext">{{dataAll.warehouseout.name}}</view>
			</view>
			<view class="flexleft margin_top paddingbom">
				<view class="nostrongtext">入库仓库：</view>
				<view class="strongtext">{{dataAll.warehousejoin.name}}</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff">
			<view class="flexbetween">
				<view class="titletext" style="flex:4;">商品名称</view>
				<view class="titletext flexcenter" style="flex: 3;">规格</view>
				<view class="titletext flexright" style="flex: 2;">数量</view>
			</view>
			<view v-for="item in dataAll.ordergoods" :key="item.id">
				<view class="flexstart margin_top2 paddingbom">
					<view class="nostrongtext ywy" style="flex: 4;">{{item.goods_info.name}}</view>
					<view class="nostrongtext flexcenter" style="flex: 3;" v-show="item.difference_type==1">{{item.goods_info.biggoodsunit.name}}</view>
					<view class="nostrongtext flexcenter" style="flex: 3;" v-show="item.difference_type==2">{{item.goods_info.middlegoodsunit.name}}</view>
					<view class="nostrongtext flexcenter" style="flex: 3;" v-show="item.difference_type==3">{{item.goods_info.smallgoodsunit.name}}</view>
					<view class="nostrongtext flexright" style="flex: 2;">*{{item.num}}</view>
				</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="titletext">合计</view>
				<view class="titletext flexright">共{{dataAll.goods_zl_num}}种/{{dataAll.goods_num}}件</view>
			</view>
			
		</view>
		<view class="flexleft mainpadding" v-if="dataAll.notes">
			<view class="nostrongtext">备注：</view>
			<view class="strongtext">{{dataAll.notes}}</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {},
				pageShow:false
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.init()
		},
		methods: {
			init() {
				httpRequest.request('/dhtapi/Dbdorder/detail', 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
					
				})
			},
			
			phone(p) {
				uni.makePhoneCall({
					phoneNumber: p.toString()
				}).catch((e) => {
					// console.log(e)  //用catch(e)来捕获错误{makePhoneCall:fail cancel}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	// 审核状态
	.wlable {
		padding: 6rpx 14rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #F3AD3D;
		line-height: 28rpx;
		background-color: #fef7ec;
	}
	.hlable{
		padding: 6rpx 14rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #ff0000;
		line-height: 28rpx;
		background-color: rgba(255, 0, 0, .1);
	}
	
	.shlable {
		padding: 6rpx 14rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #0BBDCB;
		line-height: 28rpx;
		background-color: #e7f9fa;
	}

	.paddingbom {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(153, 153, 153, 0.03);
	}

	.paddingbom:last-child {
		padding-bottom: 0;
		border: none;
	}

	.maincolor_text {
		color: #0BBDCB;
	}

	// 表格内容
	.flexcolumnleft {
		display: flex;
		align-items: flex-start;
		justify-content: flex-start;
		flex-direction: column;
	}

	.flexcolumnright {
		display: flex;
		align-items: flex-end;
		justify-content: flex-end;
		flex-direction: column;
	}

	.smalltext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	.heji {
		padding: 30rpx 30rpx 156rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}
</style>